
#import <UIKit/UIKit.h>


@interface UIColor (XMCommon)

/// 十六进制颜色 - 不透明
+ (UIColor *)xm_colorWithHexString:(NSString *)hexColor;

/// 十六进制颜色 - 可透明
+ (UIColor *)xm_colorWithHexString:(NSString *)hexColor alpha:(CGFloat)alpha;

/// 渐变
/// - Parameters:
///   - colors: @[(__bridge id)[UIColor redColor].CGColor,(__bridge id)[UIColor yellowColor].CGColor];
///   - locations: @[@0,@1];
///   - startPoint: startPoint & endPoint设置为(0,0)(1,0)代表水平方向渐变,(0,0)(0,1)代表竖直方向渐变
///   - endPoint: startPoint & endPoint设置为(0,0)(1,0)代表水平方向渐变,(0,0)(0,1)代表竖直方向渐变
///   - frame: frame
+ (CAGradientLayer *)getGraduallyChangingColor:(NSArray *)colors
                                     locations:(NSArray *)locations
                                    startPoint:(CGPoint)startPoint
                                      endPoint:(CGPoint)endPoint
                                         frame:(CGRect)frame;

/// 随机色
+ (UIColor *)randomColor;

@end
